<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE HTML>
<html>
<head>
    <meta charset="utf-8">
    <meta name="renderer" content="webkit|ie-comp|ie-stand">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
    <meta http-equiv="Cache-Control" content="no-siteapp" />
    <link rel="Bookmark" href="favicon.ico" >
    <link rel="Shortcut Icon" href="icon/x.png" />
    <!--[if lt IE 9]>
    <script type="text/javascript" src="lib/html5shiv.js"></script>
    <script type="text/javascript" src="lib/respond.min.js"></script>
    <![endif]-->
    <link rel="stylesheet" type="text/css" href="static/h-ui/css/H-ui.min.css" />
    <link rel="stylesheet" type="text/css" href="static/h-ui.admin/css/H-ui.admin.css" />
    <link rel="stylesheet" type="text/css" href="lib/Hui-iconfont/1.0.8/iconfont.css" />
    <link rel="stylesheet" type="text/css" href="static/h-ui.admin/skin/default/skin.css" id="skin" />
    <link rel="stylesheet" type="text/css" href="static/h-ui.admin/css/style.css" />
    <!--[if IE 6]>
    <script type="text/javascript" src="lib/DD_belatedPNG_0.0.8a-min.js" ></script>
    <script>DD_belatedPNG.fix('*');</script>
    <![endif]-->
    <title>纪念品商城后台管理系统</title>
    <meta name="keywords" content="纪念品商城后台管理系统 v1.0,纪念品商城,纪念品商城后台管理系统">
    <meta name="description" content="纪念品商城后台管理系统 v1.0，是一款电商后台管理系统。">
</head>
<body>
<header class="navbar-wrapper">
    <div class="navbar navbar-fixed-top">
        <div class="container-fluid cl"> <a class="logo navbar-logo f-l mr-10 hidden-xs" href="/">纪念品商城后台管理系统</a> <a class="logo navbar-logo-m f-l mr-10 visible-xs" href="/">纪念品商城后台管理系统</a>
            <%--<span class="logo navbar-slogan f-l mr-10 hidden-xs">v1.1</span>--%>
            <a aria-hidden="false" class="nav-toggle Hui-iconfont visible-xs" href="javascript:;">&#xe667;</a>
            <nav class="nav navbar-nav">
                <ul class="cl">
                    <li class="dropDown dropDown_hover"><a href="javascript:;" class="dropDown_A"><i class="Hui-iconfont">&#xe600;</i> 新增 <i class="Hui-iconfont">&#xe6d5;</i></a>
                        <ul class="dropDown-menu menu radius box-shadow">
                            <li><a href="javascript:;" onclick="product_add('添加商品','product-add')"><i class="Hui-iconfont">&#xe620;</i> 商品</a></li>
                            <li><a href="javascript:;" onclick="member_add('添加用户','member-add','','630')"><i class="Hui-iconfont">&#xe60d;</i> 用户</a></li>
                        </ul>
                        <%--<li class="navbar-levelone current"><a href="javascript:;">平台</a></li>--%>
                        <li ><a href="http://121.36.157.244:8084" target="_blank">商城前台</a></li>
                    </li>
                </ul>
            </nav>
            <nav id="Hui-userbar" class="nav navbar-nav navbar-userbar hidden-xs">
                <ul class="cl">
                    <li style="right:5px" id="role"></li>
                    <li class="dropDown dropDown_hover">
                        <a href="#" class="dropDown_A"><sapn id="username"></sapn> <i class="Hui-iconfont">&#xe6d5;</i></a>
                        <ul class="dropDown-menu menu radius box-shadow">
                            <li><a href="javascript:;" onClick="myselfinfo()">个人信息</a></li>
                            <%--<li><a onclick="logout()">切换账户</a></li>--%>
                            <li><a onclick="logout()">退出</a></li>
                        </ul>
                    </li>
                    <li id="LockScreen"> <a href="lock-screen" title="锁屏"><i class="Hui-iconfont" style="font-size:18px">&#xe60e;</i></a> </li>
                    <%--<li id="Hui-msg"> <a onclick="thanks()" title="消息"><span class="badge badge-danger">3</span><i class="Hui-iconfont" style="font-size:18px">&#xe68a;</i></a> </li>--%>
                    <li id="Hui-skin" class="dropDown right dropDown_hover"> <a href="javascript:;" class="dropDown_A" title="换肤"><i class="Hui-iconfont" style="font-size:18px">&#xe62a;</i></a>
                        <ul class="dropDown-menu menu radius box-shadow">
                            <li><a href="javascript:;" data-val="default" title="默认（蓝色）">默认（蓝色）</a></li>
                            <li><a href="javascript:;" data-val="black" title="黑色">黑色</a></li>
                            <li><a href="javascript:;" data-val="green" title="绿色">绿色</a></li>
                            <li><a href="javascript:;" data-val="red" title="红色">红色</a></li>
                            <li><a href="javascript:;" data-val="yellow" title="黄色">黄色</a></li>
                            <li><a href="javascript:;" data-val="orange" title="橙色">橙色</a></li>
                        </ul>
                    </li>
                </ul>
            </nav>
        </div>
    </div>
</header>
<aside class="Hui-aside">
    <div class="menu_dropdown bk_2">
        <dl id="menu-product">
            <dt><i class="Hui-iconfont">&#xe620;</i> 商品管理<i class="Hui-iconfont menu_dropdown-arrow">&#xe6d5;</i></dt>
            <dd>
                <ul>
                    <li><a data-href="product-category" data-title="分类管理" href="javascript:void(0)">分类管理</a></li>
                    <li><a data-href="product-list" data-title="商品列表" href="javascript:void(0)">商品列表</a></li>
                </ul>
            </dd>
        </dl>
        <dl id="menu-order">
            <dt><i class="Hui-iconfont">&#xe627;</i> 订单管理<i class="Hui-iconfont menu_dropdown-arrow">&#xe6d5;</i></dt>
            <dd>
                <ul>
                    <li><a data-href="order-list" data-title="订单列表" href="javascript:void(0)">订单列表</a></li>
                </ul>
                <ul>
                    <li><a data-href="order-statistic" data-title="订单统计" href="javascript:void(0)">订单统计</a></li>
                </ul>
                <ul>
                    <li><a data-href="sales-ranking" data-title="商品销售排行" href="javascript:void(0)">商品销售排行</a></li>
                </ul>
                <ul>
                    <li><a data-href="org-ranking" data-title="部门申领排行" href="javascript:void(0)">部门申领排行</a></li>
                </ul>
            </dd>
        </dl>
        <dl id="menu-member">
            <dt><i class="Hui-iconfont">&#xe60d;</i> 账户管理<i class="Hui-iconfont menu_dropdown-arrow">&#xe6d5;</i></dt>
            <dd>
                <ul>
                    <li><a data-href="member-list" data-title="内部用户列表" href="javascript:;">内部用户列表</a></li>
                    <li><a data-href="out-member-list" data-title="外部用户列表" href="javascript:;">外部用户列表</a></li>
                    <li><a data-href="admin-list" data-title="管理员列表" href="javascript:;">管理员列表</a></li>
                    <li><a data-href="admin-role" data-title="角色管理" href="javascript:void(0)">角色管理</a></li>
                    <li><a data-href="admin-permission" data-title="权限管理" href="javascript:void(0)">权限管理</a></li>
                    <li><a data-href="organization-list" data-title="部门管理" href="javascript:;">部门管理</a></li>
                </ul>
            </dd>
        </dl>
        <dl id="menu-chart">
            <dt><i class="Hui-iconfont">&#xe61e;</i> 统计报表<i class="Hui-iconfont menu_dropdown-arrow">&#xe6d5;</i></dt>
            <dd>
                <ul>
                    <li><a data-href="stock-list" data-title="库存管理" href="javascript:void(0)">库存管理</a></li>
                    <li><a data-href="item-sales-statistic" data-title="商品销量报表" href="javascript:void(0)">商品销量报表</a></li>
                    <li><a data-href="org-apply-statistic" data-title="部门申领报表" href="javascript:void(0)">部门申领报表</a></li>
                    <li><a data-href="user-apply-statistic" data-title="用户申领报表" href="javascript:void(0)">用户申领报表</a></li>
                    <li><a data-href="org-month-report" data-title="部门申领金额月报" href="javascript:void(0)">部门申领金额月报</a></li>
                </ul>
            </dd>
        </dl>
        <dl id="menu-system">
            <dt><i class="Hui-iconfont">&#xe62e;</i> 系统设置<i class="Hui-iconfont menu_dropdown-arrow">&#xe6d5;</i></dt>
            <dd>
                <ul>
                    <li><a data-href="nav-list" data-title="导航栏设置" href="javascript:void(0)">导航栏设置</a></li>
                    <li><a data-href="content-banner-list" data-title="轮播图设置" href="javascript:void(0)">轮播图设置</a></li>
                    <li><a data-href="other-setting" data-title="其他设置" href="javascript:void(0)">其他设置</a></li>
                </ul>
            </dd>
        </dl>
           <dl id="menu-remind">
               <dt><i class="Hui-iconfont">&#xe62f;</i> 通知管理<i class="Hui-iconfont menu_dropdown-arrow">&#xe6d5;</i></dt>
               <dd>
                   <ul>
                       <li><a data-href="org-balance-remind" data-title="部门余额不足通知" href="javascript:void(0)">部门余额不足通知</a></li>
                       <li><a data-href="stock-remind" data-title="商品库存不足通知" href="javascript:void(0)">商品库存不足通知</a></li>
                       <li><a data-href="approval-remind" data-title="审批通知" href="javascript:void(0)">审批通知</a></li>
                       <li><a data-href="pickup-remind" data-title="取货通知" href="javascript:void(0)">取货通知</a></li>
                   </ul>
               </dd>
           </dl>
           <dl id="menu-news">
               <dt><i class="Hui-iconfont">&#xe63b;</i> 资讯管理<i class="Hui-iconfont menu_dropdown-arrow">&#xe6d5;</i></dt>
               <dd>
                   <ul>
                       <li><a data-href="news-list" data-title="资讯列表" href="javascript:void(0)">资讯列表</a></li>
                   </ul>
               </dd>
           </dl>
           <dl id="menu-article">
               <dt><i class="Hui-iconfont">&#xe616;</i> 内容管理<i class="Hui-iconfont menu_dropdown-arrow">&#xe6d5;</i></dt>
               <dd>
                   <ul>
                       <li><a data-href="article-list" data-title="内容列表" href="javascript:void(0)">内容列表</a></li>
                   </ul>
               </dd>
           </dl>
            <dl id="menu-advice">
                <dt><i class="Hui-iconfont">&#xe70c;</i> 意见建议<i class="Hui-iconfont menu_dropdown-arrow">&#xe6d5;</i></dt>
                <dd>
                    <ul>
                        <li><a data-href="advice-list" data-title="建议列表" href="javascript:void(0)">建议列表</a></li>
                    </ul>
                </dd>
            </dl>
    </div>

</aside>
<div class="dislpayArrow hidden-xs"><a class="pngfix" href="javascript:void(0);" onClick="displaynavbar(this)"></a></div>
<section class="Hui-article-box">
    <div id="Hui-tabNav" class="Hui-tabNav hidden-xs">
        <div class="Hui-tabNav-wp">
            <ul id="min_title_list" class="acrossTab cl">
                <li class="active">
                    <span title="商品列表" data-href="product-list">商品列表</span>
                    <em></em></li>
            </ul>
        </div>
        <div class="Hui-tabNav-more btn-group"><a id="js-tabNav-prev" class="btn radius btn-default size-S" href="javascript:;"><i class="Hui-iconfont">&#xe6d4;</i></a><a id="js-tabNav-next" class="btn radius btn-default size-S" href="javascript:;"><i class="Hui-iconfont">&#xe6d7;</i></a></div>
    </div>
    <div id="iframe_box" class="Hui-article">
        <div class="show_iframe">
            <div style="display:none" class="loading"></div>
            <iframe scrolling="yes" frameborder="0" src="product-list"></iframe>
        </div>
    </div>
</section>

<div class="contextMenu" id="Huiadminmenu">
    <ul>
        <li id="closethis">关闭当前 </li>
        <li id="closeall">关闭全部 </li>
    </ul>
</div>
<!--_footer 作为公共模版分离出去-->
<script type="text/javascript" src="lib/jquery/1.9.1/jquery.min.js"></script>
<script type="text/javascript" src="lib/layer/2.4/layer.js"></script>
<script type="text/javascript" src="static/h-ui/js/H-ui.min.js"></script>
<script type="text/javascript" src="static/h-ui.admin/js/H-ui.admin.js"></script> <!--/_footer 作为公共模版分离出去-->

<!--请在下方写此页面业务相关的脚本-->
<script type="text/javascript" src="lib/jquery.contextmenu/jquery.contextmenu.r2.js"></script>
<script type="text/javascript">
    var username="",description="",sex="",phone="",email="",address="",createTime="",image="",roleId ="";
    $(function(){
        $("body").Huitab({
            tabBar:".navbar-wrapper .navbar-levelone",
            tabCon:".Hui-aside .menu_dropdown",
            className:"current",
            index:0,
        });
        $.ajax({
            type: 'GET',
            url: '/user/userInfo',
            success:function (data) {
                if(data.success==true){
                    $("#role").html(data.result.description);
                    $("#username").html(data.result.username);
                    username=data.result.username;
                    description=data.result.description;
                    sex=data.result.sex;
                    phone=data.result.phone;
                    email=data.result.email;
                    address=data.result.address;
                    createTime=data.result.createTime;
                    image=data.result.image;
                    roleId=data.result.roleId;
                }else {
                    layer.alert(data.message,{title: '错误信息',icon: 2});
                }
            },
            error:function(XMLHttpRequest){
                layer.alert('数据处理失败! 错误码:'+XMLHttpRequest.status+' 错误信息:'+JSON.parse(XMLHttpRequest.responseText).message,{title: '错误信息',icon: 2});
            }
        });

        //部门余额不足警告，一天只弹一次
        if(roleId == 2){
            var c = getCookie("remind");
            if (c == null) {
                $.ajax({
                    type: 'POST',
                    url: '/organization/getBalanceNotEnoughOrgList',
                    success:function (data) {
                        var size=data.result.length;
                        if(size>0){
                            var name = "";
                            for(var i=0;i<size;i++){
                                name += data.result[i].name + "，";
                            }
                            name = name.substring(0,name.length-1);
                            layer.alert('以下部门余额不足，请及时充值：</br>'+name,{title: '警告',icon: 0});
                        }
                    }
                });
                register(1);
            }
        }
    });

    /*个人信息*/
    function myselfinfo(){
        layer_show('管理员信息','admin-show',360,350);
    }
    
    /*产品-添加*/
    function product_add(title,url){
        var index = layer.open({
            type: 2,
            title: title,
            content: url
        });
        layer.full(index);
    }
    /*用户-添加*/
    function member_add(title,url,w,h){
        layer_show(title,url,w,h);
    }



    //定义Cookie
    function setCookie(name, value, expire) {
        window.document.cookie = name + "=" + escape(value) + ((expire == null) ? "" : ("; expires=" + expire.toGMTString()));
    }
    function getCookie(Name) {
        var search = Name + "=";
        if (window.document.cookie.length > 0) {
            // 如果没有则下一个
            offset = window.document.cookie.indexOf(search);
            if (offset != -1) {
                // 如果找到
                offset += search.length;
                // 设置开始
                end = window.document.cookie.indexOf(";", offset)
                // 结束
                if (end == -1)
                    end = window.document.cookie.length;
                return unescape(window.document.cookie.substring(offset, end));
            }
        }
        return null;
    }
    function register(name) {
        var today = new Date();
        var expires = new Date();
        expires.setTime(today.getTime() + 1000 * 60 * 60 * 24);
        setCookie("remind", name, expires);
    }

    function logout() {
        $.ajax({
            type: 'GET',
            url: '/user/logout',
            success:function (data) {
                window.location.href="/login";
            },
            error:function(XMLHttpRequest){
                layer.alert('数据处理失败! 错误码:'+XMLHttpRequest.status+' 错误信息:'+JSON.parse(XMLHttpRequest.responseText).message,{title: '错误信息',icon: 2});
            }
        });
    }

    function thanks(){
        layer.open({
            title: '捐赠',
            type: 2,
            skin: 'layui-layer-rim', //加上边框
            area: ['525px', '300px'], //宽高
            content: ['thanks-pic','no']
        });
    }
</script>
</body>
</html>
